package ribbon;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import ribbon.MyRoundRobinRule;

/**
 * @author Administrator
 * @Decription 注意当使用自己ribbon负载均衡算法的时候自定义规则类不能喝springboot启动类在同一包下
 */
@Configuration
public class MyRule {

    @Bean
    public IRule MyRule() {
        return new RandomRule();
    }

}
